﻿#region USING
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Threading;
using System.Net;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
#endregion

public class Poisk
{
    public static List<Poisk> List
    {
        get
        {
            List<Poisk> list = new List<Poisk>();
            list.Add(new Poisk(0, "Yandex", @"yandex.ru", Client.nastr.yandex - 200, Client.nastr.yandex + 200, 50,
                new Regex(Client.nastr.y_reg, RegexOptions.IgnoreCase | RegexOptions.Singleline)));
            list.Add(new Poisk(1, "Google", @"www.google.ru", Client.nastr.google - 200, Client.nastr.google - 200, 100,
                new Regex(Client.nastr.g_reg, RegexOptions.IgnoreCase | RegexOptions.Singleline)));
            return list;
        }
    }
    public byte id;
    public string name { get; set; }
    public string url { get; set; }
    public int wait { get { return (int)R.Next(this.min, this.max); } }
    public Regex reg = null;
    public int PageSize { get; set; }
    static Random R = new Random();
    int min { get; set; }
    int max { get; set; }
    public Poisk(byte _id, string _name, string _url, int _min, int _max, int _ps, Regex _reg)
    {
        id = _id;
        this.name = _name;
        this.url = _url;
        this.min = _min;
        this.max = _max;
        this.reg = _reg;
        this.PageSize = _ps;
    }
    public override string ToString()
    {
        return this.name;
    }
}